home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / vm.h,v < prev    next >
Encoding:
Text File  |  1991-09-26  |  9.9 KB  |  418 lines

  1. head     1.8;
  2. branch   ;
  3. access   ;
  4. symbols  sprited:1.8.1;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.8
  10. date     91.03.01.22.11.43;  author kupfer;  state Exp;
  11. branches 1.8.1.1;
  12. next     1.7;
  13.  
  14. 1.7
  15. date     90.10.19.15.41.11;  author shirriff;  state Exp;
  16. branches ;
  17. next     1.6;
  18.  
  19. 1.6
  20. date     89.09.08.13.16.39;  author shirriff;  state Exp;
  21. branches ;
  22. next     1.5;
  23.  
  24. 1.5
  25. date     89.06.23.11.30.10;  author rab;  state Exp;
  26. branches ;
  27. next     1.4;
  28.  
  29. 1.4
  30. date     89.06.07.13.19.04;  author shirriff;  state Exp;
  31. branches ;
  32. next     1.3;
  33.  
  34. 1.3
  35. date     89.03.27.22.24.03;  author jhh;  state Exp;
  36. branches ;
  37. next     1.2;
  38.  
  39. 1.2
  40. date     88.09.22.20.04.10;  author nelson;  state Exp;
  41. branches ;
  42. next     1.1;
  43.  
  44. 1.1
  45. date     88.06.21.09.37.02;  author ouster;  state Exp;
  46. branches ;
  47. next     ;
  48.  
  49. 1.8.1.1
  50. date     91.09.25.21.41.54;  author kupfer;  state Exp;
  51. branches ;
  52. next     ;
  53.  
  54.  
  55. desc
  56. @@
  57.  
  58.  
  59. 1.8
  60. log
  61. @Split out types and constants into vmTypes.h so that compiles with
  62. function prototypes will work.
  63.  
  64. @
  65. text
  66. @/*
  67.  * vm.h --
  68.  *
  69.  *     User virtual memory structures.
  70.  *
  71.  * Copyright 1985 Regents of the University of California
  72.  * All rights reserved.
  73.  *
  74.  *
  75.  * $Header: /sprite/src/lib/include/RCS/vm.h,v 1.7 90/10/19 15:41:11 shirriff Exp Locker: kupfer $ SPRITE (Berkeley)
  76.  */
  77.  
  78. #ifndef _VMUSER
  79. #define _VMUSER
  80.  
  81. #include <sprite.h>
  82. #include <vmStat.h>
  83. #ifdef KERNEL
  84. #include <user/vmTypes.h>
  85. #include <user/proc.h>
  86. #else
  87. #include <vmTypes.h>
  88. #include <proc.h>
  89. #endif
  90.  
  91. /*
  92.  * System calls.
  93.  */
  94. extern    ReturnStatus    Vm_PageSize _ARGS_((int *pageSizePtr));
  95. extern    ReturnStatus    Vm_CreateVA _ARGS_((Address address, int size));
  96. extern    ReturnStatus    Vm_DestroyVA _ARGS_((Address address, int size));
  97. extern    ReturnStatus    Vm_Cmd _ARGS_((int command, int arg));
  98. extern    ReturnStatus    Vm_GetSegInfo _ARGS_((Proc_PCBInfo *infoPtr,
  99.     Vm_SegmentID segID, int infoSize, Address segBufPtr));
  100.  
  101. #endif /* _VMUSER */
  102. @
  103.  
  104.  
  105. 1.8.1.1
  106. log
  107. @Initial branch for Sprite server.
  108. @
  109. text
  110. @d10 1
  111. a10 1
  112.  * $Header: /sprite/src/lib/include/RCS/vm.h,v 1.8 91/03/01 22:11:43 kupfer Exp $ SPRITE (Berkeley)
  113. @
  114.  
  115.  
  116. 1.7
  117. log
  118. @Removed unneeded declaration.
  119. @
  120. text
  121. @d10 1
  122. a10 1
  123.  * $Header: /sprite/src/lib/include/RCS/vm.h,v 1.6 89/09/08 13:16:39 shirriff Exp Locker: shirriff $ SPRITE (Berkeley)
  124. d16 9
  125. a24 2
  126. #include "sprite.h"
  127. #include "vmStat.h"
  128. a26 148
  129.  * The different commands to give to Vm_Cmd.  For more details on these
  130.  * options look at the man page for vmcmd.
  131.  *
  132.  *    VM_SET_CLOCK_PAGES        Set the number of pages to check on
  133.  *                    each iteration of the clock algorithm
  134.  *    VM_SET_CLOCK_INTERVAL        Set how many seconds between iterations
  135.  *                    of the clock algorithm.
  136.  *    VM_SET_MAX_DIRTY_PAGES        Set the maximum number of dirty pages
  137.  *                    to check before waiting for clean 
  138.  *                    memory.
  139.  *    VM_DO_COPY_IN            Time Vm_CopyIn.
  140.  *    VM_DO_COPY_OUT            Time Vm_CopyOut.
  141.  *    VM_DO_MAKE_ACCESS_IN        Time Vm_MakeAccessible.
  142.  *    VM_DO_MAKE_ACCESS_OUT        Time Vm_MakeAccessible.
  143.  *    VM_SET_COPY_SIZE            Set the number of bytes to move when
  144.  *                    using the previous 4 commands.
  145.  *    VM_GET_STATS            Return vm stats.
  146.  *    VM_SET_PAGEOUT_PROCS        Set the number of processes used 
  147.  *                    to clean memory.
  148.  *    VM_SET_COW            Set the flags which determines whether
  149.  *                    to use copy-on-write or not.
  150.  *    VM_COUNT_DIRTY_PAGES        Determine how many pages in memory
  151.  *                    are dirty.
  152.  *    VM_SET_FREE_WHEN_CLEAN        Set the flag which determines whether
  153.  *                    to free memory after it is cleaned.
  154.  *    VM_FLUSH_SEGMENT            Flush a segment from memory.
  155.  *    VM_SET_FS_PENALTY            Set the file system penalty .
  156.  *    VM_SET_NUM_PAGE_GROUPS        Set the number of pages groups to 
  157.  *                    divide memory into when calculating
  158.  *                    the penalty.
  159.  *    VM_SET_ALWAYS_REFUSE        Always refuse file system requests for
  160.  *                    memory.
  161.  *    VM_SET_ALWAYS_SAY_YES        Always satisfy file system request for
  162.  *                    memory if possible.
  163.  *    VM_RESET_FS_STATS            Clear out the min and max size of
  164.  *                    the file system cache kept in the
  165.  *                    vm stat structure.
  166.  *    VM_SET_COR_READ_ONLY        Set the flag which determines if pages
  167.  *                    that are copied because of copy-on-ref
  168.  *                    faults are marked read-only.
  169.  *    VM_SET_PREFETCH            Turn prefetch on or off.
  170.  *    VM_SET_USE_FS_READ_AHEAD        Say whether to use the file systems
  171.  *                    read-ahead to help out vm paging.
  172.  *    VM_START_TRACING            Start virtual memory tracing.
  173.  *    VM_END_TRACING            Stop virtual memory tracing.
  174.  *    VM_SET_WRITEABLE_PAGEOUT        Set flag which forces all writeable
  175.  *                    pages to be written out to swap when
  176.  *                    they are recycled whether they are
  177.  *                    dirty or not.
  178.  *    VM_SET_WRITEABLE_REF_PAGEOUT    Set flag which forces all writeable
  179.  *                    pages that have been referenced to be
  180.  *                    written out to swap when they are 
  181.  *                    recycled whether they are dirty or not.
  182.  */
  183. #define VM_SET_CLOCK_PAGES        0
  184. #define VM_SET_CLOCK_INTERVAL        1
  185. #define VM_SET_MAX_DIRTY_PAGES        4
  186. #define VM_DO_COPY_IN            5
  187. #define VM_DO_COPY_OUT            6
  188. #define VM_DO_MAKE_ACCESS_IN        7
  189. #define VM_DO_MAKE_ACCESS_OUT        8
  190. #define VM_SET_COPY_SIZE        9
  191. #define VM_GET_STATS            10
  192. #define VM_SET_PAGEOUT_PROCS        11
  193. #define VM_FORCE_SWAP            12
  194. #define VM_SET_COW            13
  195. #define VM_COUNT_DIRTY_PAGES        14
  196. #define VM_SET_FREE_WHEN_CLEAN        15
  197. #define VM_FLUSH_SEGMENT        16
  198. #define VM_SET_FS_PENALTY        17
  199. #define VM_SET_NUM_PAGE_GROUPS        18
  200. #define VM_SET_ALWAYS_REFUSE        19
  201. #define VM_SET_ALWAYS_SAY_YES        20
  202. #define VM_RESET_FS_STATS        21
  203. #define VM_SET_COR_READ_ONLY        22
  204. #define VM_SET_PREFETCH            23
  205. #define VM_SET_USE_FS_READ_AHEAD    24
  206. #define VM_START_TRACING        25
  207. #define VM_END_TRACING            26
  208. #define    VM_SET_WRITEABLE_PAGEOUT    27
  209. #define    VM_SET_WRITEABLE_REF_PAGEOUT    28
  210.  
  211. /*
  212.  * The first allowable machine dependent command.
  213.  */
  214. #define    VM_FIRST_MACH_CMD        50
  215.  
  216. /*
  217.  * Number of segments
  218.  */
  219.  
  220. #define    VM_NUM_SEGMENTS        4
  221.  
  222. /*
  223.  * Implementation independent definition of sement ids.
  224.  */
  225.  
  226. typedef int Vm_SegmentID;
  227.  
  228. /*
  229.  * The type of segment.
  230.  */
  231. #define VM_SYSTEM    0
  232. #define VM_CODE        1
  233. #define VM_HEAP        2
  234. #define VM_STACK    3
  235. #define VM_SHARED    4
  236.  
  237.  
  238. /*
  239.  * Length of the object file name that is embedded in each segment table
  240.  * entry.
  241.  */
  242. #define    VM_OBJ_FILE_NAME_LENGTH    50
  243.  
  244. /*
  245.  * Segment information. Add any new fields to the end of the structure.
  246.  */
  247.  
  248. typedef struct Vm_SegmentInfo {
  249.     int            segNum;        /* The number of this segment. */
  250.     int         refCount;    /* Number of processes using this 
  251.                      * segment */
  252.                         /* Name of object file for code 
  253.                      * segments. */
  254.     char        objFileName[VM_OBJ_FILE_NAME_LENGTH];
  255.     int               type;        /* CODE, STACK, HEAP, or SYSTEM */
  256.     int            numPages;    /* Explained in vmInt.h. */
  257.     int            ptSize;        /* Number of pages in the page table */
  258.     int            resPages;    /* Number of pages in physical memory
  259.                      * for this segment. */
  260.     int            flags;        /* Flags to give information about the
  261.                      * segment table entry. */
  262.     int            ptUserCount;    /* The number of current users of this
  263.                      * page table. */
  264.     int            numCOWPages;    /* Number of copy-on-write pages that
  265.                      * this segment references. */
  266.     int            numCORPages;    /* Number of copy-on-ref pages that
  267.                      * this segment references. */
  268.     Address        minAddr;    /* Minimum address that the segment
  269.                      * can ever have. */
  270.     Address        maxAddr;    /* Maximium address that the segment
  271.                      * can ever have. */
  272.     int            traceTime;    /* The last trace interval that this
  273.                      * segment was active. */
  274. } Vm_SegmentInfo;
  275.  
  276. /*
  277. d29 6
  278. a34 5
  279. extern    ReturnStatus    Vm_PageSize();
  280. extern    ReturnStatus    Vm_CreateVA();
  281. extern    ReturnStatus    Vm_DestroyVA();
  282. extern    ReturnStatus    Vm_Cmd();
  283. extern    ReturnStatus    Vm_GetSegInfo();
  284. @
  285.  
  286.  
  287. 1.6
  288. log
  289. @Added VM_SHARED definition.
  290. @
  291. text
  292. @d10 1
  293. a10 1
  294.  * $Header: /sprite/src/lib/include/RCS/vm.h,v 1.5 89/06/23 11:30:10 rab Exp Locker: shirriff $ SPRITE (Berkeley)
  295. a16 1
  296. #include "vmMach.h"
  297. @
  298.  
  299.  
  300. 1.5
  301. log
  302. @*** empty log message ***
  303. @
  304. text
  305. @d10 1
  306. a10 1
  307.  * $Header: /sprite/src/lib/include/RCS/vm.h,v 1.4 89/06/07 13:19:04 shirriff Exp Locker: rab $ SPRITE (Berkeley)
  308. d127 1
  309. @
  310.  
  311.  
  312. 1.4
  313. log
  314. @Fixed typo in comments.
  315. @
  316. text
  317. @d10 1
  318. a10 1
  319.  * $Header: /sprite/src/lib/include/RCS/vm.h,v 1.3 89/03/27 22:24:03 jhh Exp Locker: shirriff $ SPRITE (Berkeley)
  320. d176 1
  321. a176 1
  322. #endif _VMUSER
  323. @
  324.  
  325.  
  326. 1.3
  327. log
  328. @moved segment info stuff out of kernel vm.h file
  329. @
  330. text
  331. @d10 1
  332. a10 1
  333.  * $Header: /sprite/src/lib/include/RCS/vm.h,v 1.2 88/09/22 20:04:10 nelson Exp Locker: jhh $ SPRITE (Berkeley)
  334. d21 1
  335. a21 1
  336.  * The different commands to give to Vm_Cmd.  For more details no these
  337. @
  338.  
  339.  
  340. 1.2
  341. log
  342. @Changed from enum to #defines in order to allow machine dependent 
  343. vm commands.
  344. @
  345. text
  346. @d10 1
  347. a10 1
  348.  * $Header: vm.h,v 2.13 88/06/17 16:40:37 nelson Exp $ SPRITE (Berkeley)
  349. d18 1
  350. d108 67
  351. a174 3
  352. extern ReturnStatus Vm_CreateVA();
  353. extern ReturnStatus Vm_DestroyVA();
  354. extern ReturnStatus Vm_PageSize();
  355. @
  356.  
  357.  
  358. 1.1
  359. log
  360. @Initial revision
  361. @
  362. text
  363. @d2 1
  364. a2 1
  365.  * vmUser.h --
  366. d4 1
  367. a4 2
  368.  *     Commands to give to the virtual memory command routine.
  369.  *     the virtual memory module.
  370. d6 2
  371. a7 8
  372.  * Copyright 1985, 1988 Regents of the University of California
  373.  * Permission to use, copy, modify, and distribute this
  374.  * software and its documentation for any purpose and without
  375.  * fee is hereby granted, provided that the above copyright
  376.  * notice appear in all copies.  The University of California
  377.  * makes no representations about the suitability of this
  378.  * software for any purpose.  It is provided "as is" without
  379.  * express or implied warranty.
  380. d9 1
  381. a15 1
  382. #ifndef _SPRITE
  383. d17 1
  384. a17 1
  385. #endif
  386. d19 87
  387. a105 29
  388. typedef enum {
  389.     VM_SET_CLOCK_PAGES,
  390.     VM_SET_CLOCK_INTERVAL,
  391.     VM_FORCE_REF,
  392.     VM_IGNORE_DIRT,
  393.     VM_SET_MAX_DIRTY_PAGES,
  394.     VM_DO_COPY_IN,
  395.     VM_DO_COPY_OUT,
  396.     VM_DO_MAKE_ACCESS_IN,
  397.     VM_DO_MAKE_ACCESS_OUT,
  398.     VM_SET_COPY_SIZE,
  399.     VM_GET_STATS,
  400.     VM_SET_PAGEOUT_PROCS,
  401.     VM_FORCE_SWAP,
  402.     VM_SET_COW,
  403.     VM_COUNT_DIRTY_PAGES,
  404.     VM_SET_FREE_WHEN_CLEAN,
  405.     VM_FLUSH_SEGMENT,
  406.     VM_SET_FS_PENALTY,
  407.     VM_SET_NUM_PAGE_GROUPS,
  408.     VM_SET_ALWAYS_REFUSE,
  409.     VM_SET_ALWAYS_SAY_YES,
  410.     VM_RESET_FS_STATS,
  411.     VM_SET_COR_READ_ONLY,
  412.     VM_SET_PREFETCH,
  413.     VM_SET_USE_FS_READ_AHEAD,
  414.     VM_START_TRACING,
  415.     VM_END_TRACING,
  416. } Vm_Command;
  417. @
  418.